﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using DataAccess;
using System.Windows.Controls;
using SPIWareMVVM.Views.Commands;

namespace SPIWareMVVM.ViewModels
{
    public class CustomersViewModel : BaseViewModel
    {
        public Customer SelectedCustomer;

        List<Customer> _customers;
        public List<Customer> Customers
        {
            get
            {
                if (_customers == null)
                {
                    _customers = (from c in context.Customers select c).ToList();
                }
                return _customers;
            }
            set { _customers = value; }
        }
        public ObservableCollection<Customer> ocCustomers { get { return ApplicationData.ocCustomers; } set { } }
        //{
        //    get
        //    {
        //        if (_customers == null) _customers = (from c in context.Customers select c).ToList();
        //        return DataExtensions.ToObservableCollection<Customer>(_customers);
        //    }
        //    set { }
        //}
    }
}
